from keras import initializations
from keras.layers.core import MaskedLayer
from keras import backend as K
import numpy as np
import theano.tensor as T

class various_activation(MaskedLayer):
    def __init__(self, init='zero', weights=None, **kwargs):
        super(various_activation, self).__init__(**kwargs)

    def get_output(self, train):
        X = self.get_input(train)
        a1 = K.tanh(X[:,0:250])
        a2 = K.sigmoid(X[:,250:])
        return T.horizontal_stack(a1, a2)

    def get_config(self):
        config = {'name': self.__class__.__name__,
                  'init': self.init.__name__}
        base_config = super(various_activation, self).get_config()
        return dict(list(base_config.items()) + list(config.items()))
